package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="market_point_log" )
public class MarketPointLog extends BaseObject implements Serializable {
    private Long pointLogId;
    private Long adminId;
    private Long createTime;
    private Long memberId;
    private Long point;
    private String reason;
    private Long orderId;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getPointLogId() {
        return this.pointLogId;
    }
    
    public void setPointLogId(Long pointLogId) {
        this.pointLogId = pointLogId;
    }
    
    @Column(name="admin_id", nullable=false)
    public Long getAdminId() {
        return this.adminId;
    }
    
    public void setAdminId(Long adminId) {
        this.adminId = adminId;
    }
    
    @Column(name="create_time", nullable=false)
    public Long getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }
    
    @Column(name="member_id", nullable=false)
    public Long getMemberId() {
        return this.memberId;
    }
    
    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }
    
    @Column(name="point", nullable=false)
    public Long getPoint() {
        return this.point;
    }
    
    public void setPoint(Long point) {
        this.point = point;
    }
    
    @Column(name="reason", nullable=false, length=50)
    public String getReason() {
        return this.reason;
    }
    
    public void setReason(String reason) {
        this.reason = reason;
    }
    
    @Column(name="order_id", nullable=false)
    public Long getOrderId() {
        return this.orderId;
    }
    
    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MarketPointLog pojo = (MarketPointLog) o;

        if (adminId != null ? !adminId.equals(pojo.adminId) : pojo.adminId != null) return false;
        if (createTime != null ? !createTime.equals(pojo.createTime) : pojo.createTime != null) return false;
        if (memberId != null ? !memberId.equals(pojo.memberId) : pojo.memberId != null) return false;
        if (point != null ? !point.equals(pojo.point) : pojo.point != null) return false;
        if (reason != null ? !reason.equals(pojo.reason) : pojo.reason != null) return false;
        if (orderId != null ? !orderId.equals(pojo.orderId) : pojo.orderId != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (adminId != null ? adminId.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (memberId != null ? memberId.hashCode() : 0);
        result = 31 * result + (point != null ? point.hashCode() : 0);
        result = 31 * result + (reason != null ? reason.hashCode() : 0);
        result = 31 * result + (orderId != null ? orderId.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("pointLogId").append("='").append(getPointLogId()).append("', ");
        sb.append("adminId").append("='").append(getAdminId()).append("', ");
        sb.append("createTime").append("='").append(getCreateTime()).append("', ");
        sb.append("memberId").append("='").append(getMemberId()).append("', ");
        sb.append("point").append("='").append(getPoint()).append("', ");
        sb.append("reason").append("='").append(getReason()).append("', ");
        sb.append("orderId").append("='").append(getOrderId()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
